﻿@{
    ViewBag.Title = "规则码表管理";
    Layout = "~/Views/Shared/_BootstrapUI.cshtml";
}
@using FZKJ.BLL;
<link href="~/Content/bootstrap-treeview-master/dist/bootstrap-treeview.min.css" rel="stylesheet" />
<link href="~/Content/select/bootstrap-select.min.css" rel="stylesheet" />
<style type="text/css">
    .tree {
        -moz-user-select: none;
        -ms-user-select: none;
        -webkit-user-select: none;
        user-select: none;
        /*min-height: 20px;
            padding: 19px;
            margin-bottom: 20px;
            background-color: #fbfbfb;
            border: 1px solid #999;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
            -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
            -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
            box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);*/
    }

        .tree li {
            list-style-type: none;
            margin: 0;
            padding: 10px 5px 0 5px;
            position: relative;
        }

            .tree li::before, .tree li::after {
                content: '';
                left: -20px;
                position: absolute;
                right: auto;
            }

            .tree li::before {
                border-left: 1px solid #999;
                bottom: 50px;
                height: 100%;
                top: 0;
                width: 1px;
            }

            .tree li::after {
                border-top: 1px solid #999;
                height: 20px;
                top: 25px;
                width: 25px;
            }

            .tree li span {
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
                border: 1px solid #999;
                border-radius: 5px;
                display: inline-block;
                padding: 3px 8px;
                text-decoration: none;
            }
            /*.tree li.parent_li > span { cursor: pointer; }*/
            .tree li > span {
                cursor: pointer;
            }

        .tree > ul > li::before, .tree > ul > li::after {
            border: 0;
        }

        .tree li:last-child::before {
            height: 30px;
        }

    /*.tree li.parent_li > span:hover, .tree li.parent_li > span:hover + ul li span {
            background: #eee;
            border: 1px solid #94a0b4;
            color: #000;
        }*/

    .list-icon {
        -moz-user-select: none;
        -ms-user-select: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .tc_color {
        background: #d9cfcf;
    }
</style>
<div class="content-wrapper">
    <div class="row">
        <div class="col-md-5">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="pull-right">
                        <a href="#" id="delete" class="btn btn-xs btn-primary">删除</a>
                        <a href="#" id="allunfolded" class="btn btn-xs btn-primary">全部展开</a>
                        <a href="#" id="allfolded" class="btn btn-xs btn-default">全部折叠</a>
                    </div>
                    <div class="panel-title">已添加菜单</div>
                </div>
                <div class="panel-body bt">
                    <div class="tree">
                        @{
                            var bll = new FZKJ.BLL.sys_dict();
                            var dt = bll.GetList("pid='-1' and (isdel=0 or isdel is null) order by sort asc ").Tables[0];
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                <ul>
                                    <li>
                                        <span id="@dt.Rows[i]["id"]"><i>@(" " + dt.Rows[i]["label"])</i></span>
                                        @{
                                            var dt2 = bll.GetList("pid='" + dt.Rows[i]["id"].ToString() + "' and isdel=0 order by sort asc ").Tables[0];
                                            for (int j = 0; j < dt2.Rows.Count; j++)
                                            {
                                                <ul>
                                                    <li>
                                                        <span id="@dt2.Rows[j]["id"]"><i>@(" " + dt2.Rows[j]["label"])</i></span>
                                                    </li>
                                                </ul>
                                            }
                                        }
                                    </li>
                                </ul>
                                            }
                        }

                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-7">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">系统码表</div>
                </div>
                <div class="panel-body bt">
                    <form role="form" class="form-horizontal" data-parsley-validate="" novalidate="">
                        <div class="form-group">
                            <label class="col-md-2 control-label">模块名称</label>
                            <div class="col-md-10">
                                <input type="hidden" id="id" value="-1" />
                                <select id="pid" class="form-control">
                                    <option value="-1">一级目录</option>
                                    @{
                                        var dt1 = bll.GetList("pid='-1' and (isdel=0 or isdel is null)").Tables[0];
                                        for (int i = 0; i < dt1.Rows.Count; i++)
                                        {
                                            <option value="@dt1.Rows[i]["id"]">@dt1.Rows[i]["label"]</option>
                                        }
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">码表值</label>
                            <div class="col-md-10">
                                <input id="value" type="text" placeholder="码表值" class="form-control" required="required" data-parsley-error-message="码表值..." />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">显示值</label>
                            <div class="col-md-10">
                                <input id="label" type="text" maxlength="50" placeholder="显示值" class="form-control" required="required" data-parsley-error-message="显示值..." />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">码表描述</label>
                            <div class="col-md-10">
                                <input id="description" type="text" placeholder="码表描述" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">菜单排序</label>
                            <div class="col-md-10">
                                <input id="sort" type="number" placeholder="菜单排序" class="form-control" />
                            </div>
                        </div>
                    </form>
                </div>
                <div class="panel-footer text-right">
                    <button id="btnReset" type="button" class="btn btn-default"><i class="fa fa-refresh">&nbsp;&nbsp;重置</i></button>
                    <button id="btnSave" type="button" class="btn btn-primary"><i class="fa fa-save">&nbsp;&nbsp;保存</i></button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="~/Content/bootstrap-treeview-master/dist/bootstrap-treeview.min.js"></script>
<script src="~/Content/select/bootstrap-select.js"></script>
<script src="~/Pscripts/System/RoleCodeManage.js?v=@DateTime.Now.ToString("yyyyMMddHHmmssfff")"></script>